<h3>注意销量信息不是即时的,需要点击刷新按钮更新之（刷新操作比较费时）。</h3>
<p>
<span class="button refresh">刷新订单信息</span>
<span class="button sales_today_asc">按当日销量升序</span>
<span class="button sales_today_desc">按当日销量降序</span>
<span class="button sales_asc">按总销量升序</span>
<span class="button sales_desc">按总销量降序</span>
</p>
<div id="product_lists">
	 <table>
		 <tr>
			<th class="span-2">商品编号</th>
			<th class="span-3">商品名称</th>
			<th class="span-3">所属服务名称</th>
			<th class="span-11">商品描述</th>
			<th class="span-1">价格</th>
			<th class="span-2">今日销量</th>
			<th class="span-2">总销量</th>
		 </tr>
<?php
foreach( $product_stat_infos as $no=>$product_stat_info ){
?>
	 <tr>
		 <td class="align_center"><?php echo $product_stat_info['product_id']?></td>
		 <td class="align_center"><?php echo $product_stat_info['title']?></td>
		 <td class="align_center"><?php echo $product_stat_info['product_class_name_cn']?></td>
		 <td><?php echo $product_stat_info['describe']?></td>
		 <td class="align_center"><?php echo $product_stat_info['price']?></td>
		 <td class="align_center"><?php echo $product_stat_info['sales_today']?></td>
		 <td class="align_center"><?php echo $product_stat_info['sales']?></td>
	 </tr>
<?php
}
?>
	  </table>
<div id="pager_links"><?php echo $pager_links; ?></div>
</div>

<script type="text/javascript">
(function(){
	 var refresh_button_el = $( '.refresh' );
	 refresh_button_el.button();
	 refresh_button_el.click( function(){
		 window.location.href="/admin/order/refesh_order_stat/";
	 });

	 var sales_today_asc_button_el = $( '.sales_today_asc' );
	 sales_today_asc_button_el.button();
	 sales_today_asc_button_el.click( function(){
		 window.location.href="/admin/order/product_stat/sales_today/asc/";
	 });

	 var sales_today_desc_button_el = $( '.sales_today_desc' );
	 sales_today_desc_button_el.button();
	 sales_today_desc_button_el.click( function(){
		 window.location.href="/admin/order/product_stat/sales_today/desc/";
	 });

	 var sales_asc_button_el = $( '.sales_asc' );
	 sales_asc_button_el.button();
	 sales_asc_button_el.click( function(){
		 window.location.href="/admin/order/product_stat/sales/asc/";
	 });

	 var sales_desc_button_el = $( '.sales_desc' );
	 sales_desc_button_el.button();
	 sales_desc_button_el.click( function(){
		 window.location.href="/admin/order/product_stat/sales/desc/";
	 });
})();
</script>
